var bLogin = false;
var bEmail = false;
var bPassword = false;

$(document).ready(function() {
	
	// Apparition du formulaire d'inscription
	$('#new-user').click(function () {
		$('.second-form').fadeIn();
	});
	
	// Check login
	$('input[name=submit-new-user]').click(function () {
		// a enlever
		return true;
		var blogin;	
		
	$("#check_login").load("ajaxCheckLogin?login=" + $('input[name=login]').val(), function(response, status, xhr) {
		  if (status == "error") {
		  }
		});
	
	mdp = $("#mdp").val();
	if (mdp.length > 3)
		if ($("#mdp").val() != $("#repeat-mdp").val())
		{
			bEmail = false;
			$("#mdp").css('background-color','#962A2A');
			$("#repeat-mdp").css('background-color','#962A2A');
		}
		else
		{
			$("#mdp").css('background-color','green');
			$("#repeat-mdp").css('background-color','green');
			bEmail = true;
		}
	else
	{
		bEmail = false;
	}

		if(bLogin == false || bEmail == false || bPassword== false)
			return false;
	});
});
